/**
 * OArrays.java
 * Created by Stijn Strickx on May 21, 2008
 * Copyright 2008 Stijn Strickx, All rights reserved
 */

package sorts;

public class OArrays {

  public static Integer[] toObjectArray(int[] a) {
    Integer[] b = new Integer[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static Long[] toObjectArray(long[] a) {
    Long[] b = new Long[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static Double[] toObjectArray(double[] a) {
    Double[] b = new Double[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static Float[] toObjectArray(float[] a) {
    Float[] b = new Float[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static Character[] toObjectArray(char[] a) {
    Character[] b = new Character[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static Boolean[] toObjectArray(boolean[] a) {
    Boolean[] b = new Boolean[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static Byte[] toObjectArray(byte[] a) {
    Byte[] b = new Byte[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static int[] toPrimitiveArray(Integer[] a) {
    int[] b = new int[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static long[] toPrimitiveArray(Long[] a) {
    long[] b = new long[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static double[] toPrimitiveArray(Double[] a) {
    double[] b = new double[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static float[] toPrimitiveArray(Float[] a) {
    float[] b = new float[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static char[] toPrimitiveArray(Character[] a) {
    char[] b = new char[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static boolean[] toPrimitiveArray(Boolean[] a) {
    boolean[] b = new boolean[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }

  public static byte[] toPrimitiveArray(Byte[] a) {
    byte[] b = new byte[a.length];
    for (int i = 0; i < a.length; i++)
      b[i] = a[i];
    return b;
  }
}